/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.mldn.demo;

/**
 *
 * @author Administrator
 */
public class InstanceOfDemo {
    public static void main(String[] args) {
        A05 a05 = new B05();
        System.out.println("A05 a05 = new B05()" + (a05 instanceof A05));
        System.out.println("A05 a05 = new B05()"+ (a05 instanceof  B05));
        A05 a06 = new A05();
        System.out.println("A05 a06 = new A05(): "+(a06 instanceof A05));
        System.out.println("A05 a06 = new A05(): "+(a06 instanceof B05));
    }
}

class A05{
    public void fun1(){
        System.out.println("A-> void fun1(){}");
    }
    public void fun2(){
        this.fun1();
    }
}

class B05 extends A05 {
    public void fun1(){
        System.out.println("B->void fun1(){}");
    }
    
    public void fun3(){
        System.out.println("B->void fun3(){}");
    }
}